<?php
namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class CourseComment extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'course_comment';

    protected $primaryKey = 'id';

    protected $fillable = [
        'member_id', // 用户ID
        'course_id', // 课程ID
        'content', // 评论内容
        'status', // 审核状态 0-未审核 1-审核通过 2-审核不通过
    ];

    public function member()
    {
        return $this->belongsTo(Member::class, 'member_id');
    }

    public function course()
    {
        return $this->belongsTo(Course::class, 'course_id');
    }
}
